package httpServ

const statusTemp = `
<!DOCTYPE html>
<html lang="zh">

<head>
    <title>设备状态</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        body {
            font-family: "Segoe UI", "Lucida Grande", Helvetica, Arial, "Microsoft YaHei", FreeSans, Arimo, "Droid Sans", "wenquanyi micro hei", "Hiragino Sans GB", "Hiragino Sans GB W3", Arial, sans-serif;
            padding: 5px;
        }
        
        * {
            padding: 0;
            margin: 0;
        }
        
        table {
            border: 2px solid #98bf21;
            width: 100%;
            border-collapse: collapse;
        }
        
        td,
        th {
            font-size: 1em;
            border: 1px solid #98bf21;
            padding: 3px 7px 2px 7px;
        }
        
        th {
            font-size: 1.1em;
            text-align: left;
            padding-top: 5px;
            padding-bottom: 4px;
            background-color: #A7C942;
            color: #ffffff;
        }
        
        table tr:nth-child(even) {
            background-color: #EAF2D3;
        }
    </style>
</head>

<body>
    <table>
        <caption>设备状态显示</caption>
        <tr>
            <th>设备名称</th>
            <th>安装位置</th>
            <th>网络状态</th>
            <th>数据连接</th>
            <th>命令结果</th>
            <th>最新数据</th>
            <th>时间</th>
        </tr>

        <tbody>
            {{range .}}
            <tr>
                <td>{{.Name}}</td>
                <td>{{.Location}}</td>
                <td>{{.NetStatus}}</td>
                <td>{{.DataStatus}}</td>
                <td>{{.CmdStatus}}</td>
                <td>{{.LastData}}</td>
                <td>{{.LastTime}}</td>
            </tr>
            {{end}}
        </tbody>
    </table>
</body>

</html>
`
